package com.sh.data.engine.common.enumDefinition;

/**
 * @auther: zigui.zdf
 * @description:
 * @date: 2021/3/4 14:21
 */
public enum DataApiCallStatusEnum {
    SUCCESS(0, "成功"),
    TIMEOUT(1, "超时"),
    AUTH_FAIL(2, "未认证"),
    PARAM_ERR(3, "参数错误"),
    SYSTEM_ERR(4, "系统错误"),
    OTHER_ERR(5, "其他"),
    SQL_CHECK(6, "SQL校验");

    private Integer status;

    private String name;

    DataApiCallStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    public static DataApiCallStatusEnum getByStatus(Integer status) {
        for (DataApiCallStatusEnum value : DataApiCallStatusEnum.values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }
}
